using System.Text.Json.Serialization;

namespace IMClient.Model.DTO
{
    // 好友数据传输对象
    public class FriendDto
    {
        [JsonPropertyName("userId")]
        public string UserId { get; set; } = string.Empty;

        [JsonPropertyName("userName")]
        public string UserName { get; set; } = string.Empty;

        [JsonPropertyName("avatar")]
        public string Avatar { get; set; } = string.Empty;
        
        public override bool Equals(object? obj)
        {
            if (obj is FriendDto other)
            {
                return UserId == other.UserId &&
                       UserName == other.UserName &&
                       Avatar == other.Avatar;
            }
            return false;
        }

        public override int GetHashCode()
        {
            return HashCode.Combine(UserId, UserName, Avatar);
        }
    }
}
